﻿window.onload = function() {
	
	let host = window.location.host

	console.log('host: ' + host)

	var table = document.getElementsByTagName('table')[0];
	if (table) table.style.display = 'none';

	var ins = document.getElementsByTagName('ins');
	if (ins instanceof HTMLCollection) {
		for (var i = 0, l = ins.length; i < l; i++) {
			if (ins[i]) ins[i].style.display = 'none';
		}
	}

	var _cs_bf_item = document.getElementById('_cs_bf_item')
	if (_cs_bf_item) _cs_bf_item.style.display = 'none';

	var cs_right_bottom = document.getElementById('cs_right_bottom');
	if (cs_right_bottom) cs_right_bottom.style.display = 'none';

	let close_id = document.getElementsByClassName('close_id');
	if (close_id) {
		for (var i = close_id.length - 1; i >= 0; i--) {
			// close_id[i].style.display = 'none';
		}
	}

	if (host.indexOf('caodama88.com') >= 0) {
		let claze = ['topad', 'topad-list', 'slide-index', 'index-recommend', 'lim_float_icon', 'tbtcode', 'deanmaintops']
		for(let i = 0, l = claze.length; i < l; i++) {
			let el = document.getElementsByClassName(claze[i])
			if (el) {
				for(let j = 0, k = el.length; j < k; j++){
					el[j].style.display = 'none'
				}
			}
		}
	}

	if (host.indexOf('miaobige.com') >= 0) {
		let claze = ['content_ad']
		for(let i = 0, l = claze.length; i < l; i++) {
			let el = document.getElementsByClassName(claze[i])
			if (el) {
				for(let j = 0, k = el.length; j < k; j++){
					el[j].style.display = 'none'
				}
			}
		}
	}

	if (host.indexOf('biquge.in') >= 0) {
		document.querySelectorAll('div[style="margin:10px auto 0;width:790px;height:90px;border:2px dashed #ccc;line-height:80px;text-align:center;font-size:30px"]').forEach((el) => {
			el.style.display = 'none';
		})
	}
	if (host.indexOf('ccchh4.win') >= 0) {
		document.querySelectorAll('div[style="text-align: center;"]').forEach((el) => {
			el.style.display = 'none';
		})
	}
	if (host.indexOf('www.bequge.com') >= 0) {
		console.log(document.querySelectorAll('#cs_CFdivdlST_B_0'))
		document.querySelectorAll('#cs_CFdivdlST_B_0').forEach((el) => {
			console.log("disappeare")
			el.style.display = 'none';
		})
	}
	if (host.indexOf('www.bequge.com') >= 0) {
		document.querySelectorAll('script').forEach(e=>{
			if(e.src.indexOf('http://bdimg') >= 0) {
				console.log(e.src.indexOf('http://bdimg'))
				e.parentNode.removeChild(e)
			}
		})
		console.log(document.querySelectorAll('#cs_CFdivdlST_B_0'))
		document.querySelectorAll('#cs_CFdivdlST_B_0').forEach((el) => {
			console.log("disappeare")
			el.style.display = 'none';
		})
	}
	if (host.indexOf('www.shushu8.com') >= 0) {
		console.log(document.querySelectorAll('.readmidad'))
		document.querySelectorAll('.readmidad').forEach((el) => {
			console.log("disappeare")
			el.style.display = 'none';
		})
	}
	if (host.indexOf('www.xbiquge.la') >= 0) {
        let selectors = ['#coupletleft', '#coupletright', '#HMRichBox']
        selectors.forEach(item => {
            console.log(document.querySelectorAll(item))
            document.querySelectorAll(item).forEach((el) => {
                console.log("disappeare")
                el.style.display = 'none';
            })
        })
        
        document.evaluate("/html/body/div[5]/div[4]/div/p[1]", document, null, XPathResult.ANY_TYPE, null).iterateNext().style.display = 'none'
		
	}
    document.querySelectorAll('div').forEach(el=>{
        if (/_[a-z0-9]{8}-[a-z0-9]{4}-4[a-z0-9]{3}-[a-z0-9]{4}-[a-z0-9]{12}/.test(el.id)){
                el.style.display='none'
            }
        })
}